package com.buyouchina.web.action;

import java.io.Serializable;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
@Controller
public class BaseAction extends ActionSupport  implements SessionAware,ServletRequestAware,ServletResponseAware,Serializable{
	
	
	private static final long serialVersionUID = 8069173240954819631L;
	@SuppressWarnings("unchecked")
	protected Map session;
	protected HttpServletRequest request; 
	protected HttpServletResponse response; 
	
	private int page;
	private String query;
	public static final String MESSAGE="message";
	
	
	public String getQuery() {
		return query;
	}
 
	public void setQuery(String query) {
		this.query = query;
	}
	public int getPage() {
		return page<1? 1 : page;
	}

	public void setPage(int page) {
		this.page = page;
	}
	
    @SuppressWarnings("unchecked")
	public void setSession(Map session) {
        this.session = session;
    }
	public void setServletRequest(HttpServletRequest request) {
		this.request=request;
		
	}
	public void setServletResponse(HttpServletResponse response) {
		this.response=response;
	}
	
}
